package hotciv.stub;

import hotciv.framework.City;
import hotciv.framework.GameObserver;
import hotciv.framework.Player;
import hotciv.framework.Position;
import hotciv.framework.Unit;
import hotciv.standard.GameObserverImpl;

public class GameObserverStub implements GameObserver
{
	private Player nextPlayer = Player.RED;
	private int age = -4000;
	private Unit unitMoved;
	private Position unitMovedFrom;
	private Position unitMovedTo;
	private Unit lastUnitDestroyed;
	private Unit lastUnitCreated;
	private Position lastUnitCreatedPosition;
	private City lastCityCreated;
	private Position lastCityCreatedPosition;
	private City lastCityChanged;
	private Position lastCityChangedPosition;
	private Position lastUnitDestroyedPosition;
	private Position tileFocusChangePosition;

	public Player getNextPlayer()
	{
		return nextPlayer;
	}
	
	public int getAge()
	{
		return age;
	}
	
	public Unit getUnitMovedUnit()
	{
		return unitMoved;
	}
	
	public Position getUnitMovedPositionFrom()
	{
		return unitMovedFrom;
	}
	
	public Position getUnitMovedPositionTo()
	{
		return unitMovedTo;
	}
	
	public Unit getUnitDestroyed()
	{
		return lastUnitDestroyed;
	}
	
	public Position getUnitDestroyedPosition()
	{
		return lastUnitDestroyedPosition;
	}

	public Unit getUnitLastCreated() {
		return lastUnitCreated;
	}

	public Position getUnitLastCreatedPosition() 
	{
		return lastUnitCreatedPosition;
	}

	public City getLatestCityCreated() {
		return lastCityCreated;
	}

	public Position getLatestCityCreatedPosition() {
		return lastCityCreatedPosition;
	}

	public City getLastCityChanged() 
	{
		return lastCityChanged;
	}
	
	public Position getLastCityChangedPosition() 
	{
		return lastCityChangedPosition;
	}

	@Override
	public void cityChanged(City city, Position position) 
	{
		lastCityChanged = city;
		lastCityChangedPosition = position;		
	}

	@Override
	public void cityCreated(City city, Position position) 
	{
		lastCityCreated = city;
		lastCityCreatedPosition = position;		
	}

	@Override
	public void tileFocusChanged(Position position) 
	{
		this.tileFocusChangePosition = position;
	}

	@Override
	public void turnEnds(Player nextPlayer, int age) 
	{
		this.nextPlayer = nextPlayer;
		this.age = age;
	}

	@Override
	public void unitCreated(Unit unit, Position position) 
	{
		lastUnitCreated = unit;
		lastUnitCreatedPosition = position;
	}

	@Override
	public void unitDestroyed(Unit unit, Position position) 
	{
		lastUnitDestroyed = unit;
		lastUnitDestroyedPosition = position;
	}

	@Override
	public void unitMoved(Unit unit, Position from, Position to) 
	{
		unitMoved = unit;
		unitMovedFrom = from;
		unitMovedTo = to;
	}

	public Position getTileFocusChangePosition() {
		// TODO Auto-generated method stub
		return tileFocusChangePosition;
	}
}
